package jp.sourceforge.akjrcp.dropsomething;

import jp.sourceforge.akjrcp.akj_betas.Akj_betasPlugin;
import jp.sourceforge.akjrcp.akj_betas.Messages;
import jp.sourceforge.akjrcp.akj_betas.PreferenceUtils;
import jp.sourceforge.akjrcp.ui.FTPInfoEditor;

import org.eclipse.jface.preference.BooleanFieldEditor;
import org.eclipse.jface.preference.FieldEditorPreferencePage;
import org.eclipse.jface.preference.IntegerFieldEditor;
import org.eclipse.jface.preference.StringFieldEditor;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;




/**
 * This class represents a preference page that
 * is contributed to the Preferences dialog. By 
 * subclassing <samp>FieldEditorPreferencePage</samp>, we
 * can use the field support built into JFace that allows
 * us to create a page that is small and knows how to 
 * save, restore and apply itself.
 * <p>
 * This page is used to modify preferences only. They
 * are stored in the preference store that belongs to
 * the main plug-in class. That way, preferences can
 * be accessed directly via the preference store.
 */


public class FLVConvertPage
	extends FieldEditorPreferencePage
	implements IWorkbenchPreferencePage {
	
	public static final String FLVCONVERT_VIDEO_SIZE="flvconvert.video_size";
	public static  final  String FLVCONVERT_VIDEO_RATE="flvconvert.video_rate";
	public static  final  String FLVCONVERT_VIDEO_BITRATE="flvconvert.video_bitrate";
	
	public static  final  String FLVCONVERT_AUDIO_RATE="flvconvert.audio_rate";
	public static  final  String FLVCONVERT_AUDIO_BITRATE="flvconvert.audio_bitrate";
	public static  final  String FLVCONVERT_AUDIO_CHANNEL="flvconvert.audio_channel";
	
	public static  final  String FLVCONVERT_USE_AVISYNTH="flvconvert.use_avisynth";
	public static  final  String FLVCONVERT_USE_FLVTOOL2="flvconvert.use_flvtool2";
	public static  final  String FLVCONVERT_FLOWPLAYER_HTML="flvconvert.flowplayer_html";
	public static  final  String FLVCONVERT_FLOWPLAYER_SWF="flvconvert.flowplayer_swf";
	public FLVConvertPage() {
		super(GRID);
		setPreferenceStore(Akj_betasPlugin.getDefault().getPreferenceStore());
		setDescription(Messages.getString("flvconvert_setting"));
		initializeDefaults();
	}
/**
 * Sets the default values of the preferences.
 */
	private void initializeDefaults() {
		
	}
	
/**
 * Creates the field editors. Field editors are abstractions of
 * the common GUI blocks needed to manipulate various types
 * of preferences. Each field editor knows how to save and
 * restore itself.
 */

	

    protected void createFieldEditors() {
    	addField(new StringFieldEditor(FLVCONVERT_VIDEO_SIZE,Messages.getString("flvconvert.video_size"),getFieldEditorParent())); //$NON-NLS-1$
    	addField(new IntegerFieldEditor(FLVCONVERT_VIDEO_BITRATE,Messages.getString("flvconvert.video_bitrate"),getFieldEditorParent())); //$NON-NLS-1$
    	addField(new StringFieldEditor(FLVCONVERT_VIDEO_RATE,Messages.getString("flvconvert.frame_rate"),getFieldEditorParent())); //$NON-NLS-1$
    	
    	
    	
    	addField(PreferenceUtils.createFLVAudioRateFieldEditor(FLVCONVERT_AUDIO_RATE,Messages.getString("flvconvert.audio_rate"),getFieldEditorParent()));
    	addField(new IntegerFieldEditor(FLVCONVERT_AUDIO_BITRATE,Messages.getString("flvconvert.audio_bitrate"),getFieldEditorParent())); //$NON-NLS-1$
    	addField(PreferenceUtils.createAudioChannelFieldEditor(FLVCONVERT_AUDIO_CHANNEL,Messages.getString("flvconvert.audio_channel"),getFieldEditorParent()));
    	
    	addField(new BooleanFieldEditor(FLVCONVERT_FLOWPLAYER_HTML,Messages.getString("flvconvert.copy_html"),getFieldEditorParent()));
    	addField(new BooleanFieldEditor(FLVCONVERT_FLOWPLAYER_SWF,Messages.getString("flvconvert.copy_swf"),getFieldEditorParent()));
    	addField(new BooleanFieldEditor(FLVCONVERT_USE_AVISYNTH,Messages.getString("flvconvert.use_avisynth"),getFieldEditorParent()));
    	addField(new BooleanFieldEditor(FLVCONVERT_USE_FLVTOOL2,Messages.getString("flvconvert.use_flvtool2"),getFieldEditorParent()));
    	
    	/*
       
        addField(fileField);
        
        addField(new BooleanFieldEditor(PRIMARY_FLOWPLAYER,Messages.getString("primary_flowplayer"),getFieldEditorParent()));
    	
        FileFieldEditor exeField=new FileFieldEditor(
                PLAYER_PATH, Messages.getString("player_path"),getFieldEditorParent()); //$NON-NLS-1$
        exeField.setFileExtensions(new String[]{"*.exe"}); //$NON-NLS-1$
        addField(exeField);
        
        FileFieldEditor flvtool2Field=new FileFieldEditor(
                FLVTOOL2_PATH, Messages.getString("fvltool2_path"),getFieldEditorParent()); //$NON-NLS-1$
        flvtool2Field.setFileExtensions(new String[]{"flvtool2.exe"}); //$NON-NLS-1$
        addField(flvtool2Field);
        
        addField(new RadioGroupFieldEditor(
		        FLV_EXTENSION_ADD,
				Messages.getString("flv_extension_add"), // //$NON-NLS-1$
				4,
				new String[][] { { Messages.getString("flv_extension_add_auto"), FLV_EXTENSION_ADD_AUTO }, {
					//$NON-NLS-1$ //$NON-NLS-2$
					Messages.getString("flv_extension_add_dialog"), FLV_EXTENSION_ADD_DIALOG  //$NON-NLS-1$ //$NON-NLS-2$
				    
				},
				{
				Messages.getString("flv_extension_add_never"), FLV_EXTENSION_ADD_NEVER  //$NON-NLS-1$ //$NON-NLS-2$
			    
				}
				
			}, getFieldEditorParent()));
        */
        
    }
	
	public void init(IWorkbench workbench) {
	}
}